<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>null与undefined</title>
</head>
<body>
    
</body>
<script>
    // 1、相似性
    if (!null) {
        console.log('false')
    }

    console.log(undefined == null); // true
    console.log(undefined === null); // false


    let a = 5 + undefined;
    console.log(a)
    // NaN


    let b = 10 + null;
    console.log(b);
    // 10

    // 什么时候回出现undefined ？
    // 1、声明未赋值
    // 2、函数的默认返回值
    // 3、对象没有这个属性
    // 4、方法缺少实参


    let str2 = '123';
    let num = 5;
    console.log((str2 * 1)); // 128

</script>

</html>